package com.boco.blch.analysiser.compliance.HW.data;



import com.boco.blch.analysiser.compliance.ComplianceResolved;

/**
 * @author 黄戈
 * MPPDB 日志记录完整性安全基线要求项 
 *
 */

public class BOCO_gbase_LogAudit_LogRecordComplete implements ComplianceResolved {
	private final static String GbaseLogFileName = "gbased-audit.log";
	/*private final static String GclusterLogFileName = "gclusterd-audit.log";
	private final static String GbaseStart="gbase-start";
	private final static String GbaseEnd="gbase-end";
	private final static String GClusterStart="gcluster-start";
	private final static String GClusterEnd="gcluster-end";*/
	@Override
	public int realEchoResolved(String echoResult) {
		//boolean gclusterFlag=true;
		//boolean gbaseFlag=true;
		if(!echoResult.equals("")&&echoResult!= null&&(!echoResult.contains(NoPermission1)&&!echoResult.contains(NoPermission2)&&!echoResult.contains(NoPermission3))){
			//数据节点合规判断
			//String gbaseResult=echoResult.substring(echoResult.indexOf(GbaseStart)+GbaseStart.length(),echoResult.indexOf(GbaseEnd)).trim();
			//System.out.println(gbaseResult);
			if(echoResult.contains(NotFindFile)){//若文件夹不存在不合规
				return FAILED;
			}else if(echoResult.contains(GbaseLogFileName)){//包含gbased-audit.log则合规
				return SUCCESS;
			}else{
			    return FAILED;
			}
			//集群节点合规判断
			/*String gclusterResult=echoResult.substring(echoResult.indexOf(GClusterStart)+GClusterStart.length(),echoResult.indexOf(GClusterEnd)).trim();
			if(gclusterResult.contains(NotFindFile)){
				gclusterFlag=false;
			}else if(gclusterResult.contains(GclusterLogFileName)){
				gclusterFlag=true;
			}else{
				gclusterFlag=false;
			}*/
			
			
		}else{
			return FAILED;
		}
		
	}
	
	/*
*/

}
